﻿<?php
session_start();
include("admin_resist_mdl.php");
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<?php

include("../../Modules/conn.php");
$makhoa = $_GET["makhoa"];

// Tim nhung bo mon thuoc khoa
$querySelBM = "select * from bo_mon where MA_KHOA = '$makhoa'";
$resultSelBM = mysql_query($querySelBM, $conn) or die(mysql_error());
$count = mysql_num_rows($resultSelBM);

if ($count > 0) // Neu ton tai bo mon thuoc khoa
{ // Thong bao ko the xoa
	header("Location: ../View/admin_cpanel.php?info=delnotallowed");
}
else
{ // Thuc hien xoa
	$queryDelK = "delete from khoa where MA_KHOA = '$makhoa'";
	mysql_query($queryDelK, $conn) or die(mysql_error());
	mysql_close();
	header("Location: ../View/admin_cpanel.php?info=delcnksucc");
}
?>